﻿

create PROCEDURE [dbo].[proc_Consumable_GetList]
(
	@id INT	
)


AS
IF @id=0
BEGIN
	SELECT * FROM ConsumableList
END
ELSE IF @id=-1
BEGIN
	SELECT * FROM ConsumableList ORDER BY id DESC
END
ELSE IF @id=-2
BEGIN
	SELECT * FROM ConsumableList ORDER BY ConsumableName
END
ELSE
	BEGIN
		SELECT * FROM ConsumableList WHERE id=@id
	END

RETURN